{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Python是由荷兰人吉多·范罗苏姆创造，第一版发布于1991年。最近荷兰人准备退休的时候去了微软，继续python语言的开源工作。\n",
    "\n",
    "Python是多范型编程语言，包括函数式、面向对象、指令式等。\n",
    "\n",
    "Python是解释型语言，写的代码会被解释器一行一行翻译成机器码执行。而像c语言这样的编译型语言则是全部编译成机器语言目标程序，然后不需要解释器直接运行这个程序即可。\n",
    "安装Python就是得到一个解释器及相关工具和运行库。具体步骤如下：\n",
    "#### 1. 去Python官网python.org下载安装Python\n",
    "Python支持多种操作系统，比如windows，macos，linux。我选择一个合适的下载，版本最好是最新的。我们以windows举例，下载下来是个exe文件，可以直接双击执行安装。在安装过程中记得把Python加入到环境变量PATH中，如果忘了勾选也没有关系，后面可以自己加。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. 运行Python\n",
    "Python安装好之后，可以WIN+R输入CMD进入命令行，然后直接运行Python进入交互环境，最后输入测试语句Print(\"Hello Python!!!\")看看运行结果。对比Java程序或者C程序，是不是更加简洁。<br>\n",
    "然后尝试运行import this，会出来Python编程的理念。主要就是要大家设计简洁、优美的程序。等我们学完之后估计才能慢慢理解下面所有的话。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello Python!!!\n"
     ]
    }
   ],
   "source": [
    "print(\"Hello Python!!!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Zen of Python, by Tim Peters\n",
      "\n",
      "Beautiful is better than ugly.\n",
      "Explicit is better than implicit.\n",
      "Simple is better than complex.\n",
      "Complex is better than complicated.\n",
      "Flat is better than nested.\n",
      "Sparse is better than dense.\n",
      "Readability counts.\n",
      "Special cases aren't special enough to break the rules.\n",
      "Although practicality beats purity.\n",
      "Errors should never pass silently.\n",
      "Unless explicitly silenced.\n",
      "In the face of ambiguity, refuse the temptation to guess.\n",
      "There should be one-- and preferably only one --obvious way to do it.\n",
      "Although that way may not be obvious at first unless you're Dutch.\n",
      "Now is better than never.\n",
      "Although never is often better than *right* now.\n",
      "If the implementation is hard to explain, it's a bad idea.\n",
      "If the implementation is easy to explain, it may be a good idea.\n",
      "Namespaces are one honking great idea -- let's do more of those!\n"
     ]
    }
   ],
   "source": [
    "import this"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "help函数可以帮我们在写程序的迅速查看变量、函数、模块等的帮助信息。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function print in module builtins:\n",
      "\n",
      "print(...)\n",
      "    print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n",
      "    \n",
      "    Prints the values to a stream, or to sys.stdout by default.\n",
      "    Optional keyword arguments:\n",
      "    file:  a file-like object (stream); defaults to the current sys.stdout.\n",
      "    sep:   string inserted between values, default a space.\n",
      "    end:   string appended after the last value, default a newline.\n",
      "    flush: whether to forcibly flush the stream.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(print)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module this:\n",
      "\n",
      "NAME\n",
      "    this\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/this\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DATA\n",
      "    c = 97\n",
      "    d = {'A': 'N', 'B': 'O', 'C': 'P', 'D': 'Q', 'E': 'R', 'F': 'S', 'G': ...\n",
      "    i = 25\n",
      "    s = \"Gur Mra bs Clguba, ol Gvz Crgref\\n\\nOrnhgvshy vf o...bar ubaxvat ...\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\this.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(this)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过import this 可以看出python的设计哲学，强调代码的美观和简洁。相比c或java，Python开发者可以使用更少的代码写出同样的功能。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. 运行IDLE\n",
    "IDLE是一个可视化的交互式环境和编辑环境，可以创建和编辑新的.py文件，也可以进入交互式环境。我们可以使用交互式环境再次运行print(\"Hello Python!!!\")看看结果如何。\n",
    "我们也可以新建一个文件叫hello.py,文件内容就一句话print(\"Hello Python\")。然后我们在命令行通过python hello.py执行该文件，查看执行结果。IDLE很简单，如果你不满意的话，有很多优秀的IDE可以选择，放在后面的任务在说。\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
